﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EStore.Presentation.Web.ViewModels;
using EStore.Core.Catalogs;

namespace EStore.Presentation.Web.Controllers
{
    public class ProductController : Controller
    {
        public ActionResult List()
        {

            var book = new ProductBookShowModel
            {
                ProductCode = "111111",
                PromotionWords = "全场7折优惠",
                Name = "绝密同学录（创意木盒装）",
                Pic = "http://images.99read.com/Product/2012/300.300/b0001567962.jpg",
                OriginalPrice = 100,
                SalePrice = 70,
                CanSale = true,
                Category = new ProductCategory
                {
                    Code = "A",
                    Name = "图书"
                },

                Author = "kaka",
                PublisherName = "九久出版社",
                PublishDate = DateTime.Now.ToShortDateString()
            };
                
            var close = new ProductClotheShowModel
            {
                ProductCode = "1122222",
                Name = "王力宏限定版潮流长袖纯棉T恤",
                PromotionWords = "送王力宏限量版专属腕带",
                Pic = "http://images.99read.com/Product/2011/300.300/b0000T17628.jpg",
                OriginalPrice = 99,
                SalePrice = 39.99m,
                CanSale = true,
                Category = new ProductCategory
            {
                Code = "B",
                Name = "服装"
            }
            };


            var products = new List<ProductShowModel>();
            products.Add(book);
            products.Add(close);

            return View(products);
        }
    }
}
